package Dao;

import java.sql.ResultSet;

import Entity.Administrator;
import OracleHelper.OracleHelper;

public class AdministratorDao {
	
	/*
	 * 根据管理员用户名查找密码
	 */
	public Administrator queryAdminByUserName(String userName) {
		Administrator admin=null;
		try {
		String sql="select * from adminInformation where userName='"+userName+"'";
		ResultSet rs=new OracleHelper().executeQuery(sql);
		while(rs.next()) {
			String username=rs.getString(1);
			String pwd=rs.getString(2);
			admin=new Administrator(username,pwd);
		}
		OracleHelper.closeConnection();
		}catch(Exception ex) {
			ex.printStackTrace();
		}
		return admin;
		
	}

}
